#include <vector>
#include <thread>
#include <iostream>
const int THREADS_NUM = 10;
int a = 0;
int main() {
    std::vector<std::thread> threads;
    threads.reserve(static_cast<size_t>(THREADS_NUM));
    for (int i = 0; i < THREADS_NUM; ++i) {
        threads.emplace_back([&](){
            for (int j = 0; j < 10; j++) {
                a++;
                std::cout << a << std::endl; 
            }
        });
    }
    for (auto &t : threads) {
        t.join();
    }
}